//-----------------------------------------------------------------------
// <copyright file="AddMoreSellProductService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class AddMoreSellProductService
    {
        #region AddMoreSellProduct

        public static void CreateAddMoreSellProduct(AddMoreSellProduct addMoreSellProduct)
        {            
            try
            {
                AddMoreSellProductDAO addMoreSellProductDAO = new AddMoreSellProductDAO();
                addMoreSellProductDAO.CreateAddMoreSellProduct(addMoreSellProduct);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateAddMoreSellProductException, ex);
            }
        }        

        public static void UpdateAddMoreSellProduct(AddMoreSellProduct addMoreSellProduct)
        {            
            try
            {
                AddMoreSellProductDAO addMoreSellProductDAO = new AddMoreSellProductDAO();
                addMoreSellProductDAO.UpdateAddMoreSellProduct(addMoreSellProduct);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateAddMoreSellProductException, ex);
            }
        }        

        public static void DeleteAddMoreSellProduct(long addMoreId)
        {            
            try
            {
                AddMoreSellProductDAO addMoreSellProductDAO = new AddMoreSellProductDAO();
                addMoreSellProductDAO.DeleteAddMoreSellProduct(addMoreId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteAddMoreSellProductException, ex);
            }
        }
        
        public static AddMoreSellProduct GetAddMoreSellProduct(long addMoreId)
        {            
            try
            {
                AddMoreSellProductDAO addMoreSellProductDAO = new AddMoreSellProductDAO();
                return addMoreSellProductDAO.GetAddMoreSellProduct(addMoreId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetAddMoreSellProductException, ex);
            }
        }                

        public static AddMoreSellProductCollection GetAddMoreSellProductList(AddMoreSellProductColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                AddMoreSellProductDAO addMoreSellProductDAO = new AddMoreSellProductDAO();
                return addMoreSellProductDAO.GetAddMoreSellProductList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetAddMoreSellProductListException, ex);
            }
        }        

        public static AddMoreSellProductCollection GetAddMoreSellProductList(AddMoreSellProductColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                AddMoreSellProductDAO addMoreSellProductDAO = new AddMoreSellProductDAO();
                return addMoreSellProductDAO.GetAddMoreSellProductList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetAddMoreSellProductListException, ex);
            }
        }        

	    public static AddMoreSellProductCollection GetAddMoreSellProductListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                AddMoreSellProductDAO addMoreSellProductDAO = new AddMoreSellProductDAO();
                return addMoreSellProductDAO.GetAddMoreSellProductListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetAddMoreSellProductListException, ex);
            }
        }        

        public static AddMoreSellProductCollection GetAddMoreSellProductListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                AddMoreSellProductDAO addMoreSellProductDAO = new AddMoreSellProductDAO();
                return addMoreSellProductDAO.GetAddMoreSellProductListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetAddMoreSellProductListException, ex);
            }
        }        

        #endregion
    }
}